{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Matplotlib安装与概述"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "matplotlib安装：\n",
    "```\n",
    "pip3 install matplotlib\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = np.array([[5.1, 3.5],\n",
    "              [4.9, 3],\n",
    "              [4.7, 3.2],\n",
    "              [4.6, 3.1],\n",
    "              [5, 3.6],\n",
    "              [5.4, 3.9],\n",
    "              [4.6, 3.4],\n",
    "              [5, 3.4],\n",
    "              [4.4, 2.9],\n",
    "              [4.9, 3.1],\n",
    "              [5.4, 3.7],\n",
    "              [4.8, 3.4],\n",
    "              [4.8, 3],\n",
    "              [4.3, 3]])\n",
    "np.savetxt('b.txt', a)\n",
    "b = np.loadtxt('b.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5],\n",
       "       [4.9, 3. ],\n",
       "       [4.7, 3.2],\n",
       "       [4.6, 3.1],\n",
       "       [5. , 3.6],\n",
       "       [5.4, 3.9],\n",
       "       [4.6, 3.4],\n",
       "       [5. , 3.4],\n",
       "       [4.4, 2.9],\n",
       "       [4.9, 3.1],\n",
       "       [5.4, 3.7],\n",
       "       [4.8, 3.4],\n",
       "       [4.8, 3. ],\n",
       "       [4.3, 3. ]])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNC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xBuc9xUP4M92mbMi5Kqva61E31J2inpYOP+GtV/3b+91/V2oK9jkh5v3P+g6nPu7nW9Bfr5RUm3zrr/sqSdTWM+0ejPqp9onO513R3s7U5Jr0n67V7X28m+msY/J+nhMmphWqYg2/sk1SJitNe1dFJTX2OSPmb7oqRpSSPRJ2dLzZr6elLSs7Y/p/p86OPR+J+1zP2ypG82fnVfJemFiPh3238iSRHxd6q/hvCA6iH4tqQ/7lGtC1Wkty9Iul31M1tJeieW/weKFemrK3iHKgAkxJw7ACREuANAQoQ7ACREuANAQoQ7ACREuANAQoQ7ACREuANAQv8Hgvw946LytKgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(b[:,0], b[:,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(14, 2)"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b.shape"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
